<?php

namespace app;

use think\Model;

class BaseModel extends Model
{
    // 定义全局的查询范围
    //使用withoutGlobalScope()关闭全局查询
    protected $globalScope = ['is_del'];

    //定义全局查询默认不删除
    public function scopeIs_Del($query): void
    {
        $query->where('is_del',0);
    }
}